<<<<<<< HEAD
"""
又一个例子
"""

from scipy.optimize import linprog
import numpy as np

# 目标函数：min z = 2x1 + 3x2 + x3
fval = np.array([2, 3, 1])
# 不等约束
A = np.array([[-1, -4, -2], [-3, -2, 0]])
b = np.array([-8, -6])
# 决策变量的下界与上界
lb = 0
ub = None
# 求解线性规划
res = linprog(fval, A_ub=A, b_ub=b, bounds=((lb, ub), (lb, ub), (lb, ub)))
# 输出
print(res)
=======
"""
又一个例子
"""

from scipy.optimize import linprog
import numpy as np

# 目标函数：min z = 2x1 + 3x2 + x3
fval = np.array([2, 3, 1])
# 不等约束
A = np.array([[-1, -4, -2], [-3, -2, 0]])
b = np.array([-8, -6])
# 决策变量的下界与上界
lb = 0
ub = None
# 求解线性规划
res = linprog(fval, A_ub=A, b_ub=b, bounds=((lb, ub), (lb, ub), (lb, ub)))
# 输出
print(res)
>>>>>>> a66c8eec2c3bbe955d7da215f43ffffda9c7b6b5
